﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ArticleManagementSystem
{
    public partial class loginInterface : Form
    {
        public loginInterface()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void register_Click(object sender, EventArgs e)
        {
            RegistrationInterface registrationInterface = new RegistrationInterface();
            registrationInterface.Show();
        }

        private void land_Click(object sender, EventArgs e)
        {
            var uid = textBox1.Text;
            var pwd = textBox2.Text;
            var sql = string.Format("select * from Users where Username='{0}' and Password='{1}'",uid,pwd);
            var dt = DbHelper.GetData(sql);
            if (dt.Rows.Count==1)
            {
                MessageBox.Show("登陆成功！");
                Mainwebsite mainwebsite = new Mainwebsite();
                mainwebsite.Show();
                this.Hide();

            }
            else
            {
                MessageBox.Show("登陆失败！");
            }
        }
    }
}
